
/**
 * @description 登录流程 , 不用导出
 */

import { Entry } from "../../quick/core/entry/Entry";
import { LogicManager } from "../../quick/core/logic/LogicManager";
import { registerEntry } from "../../quick/defines/Decorators";
import { Macro } from "../../quick/defines/Macros";
import { Singleton } from "../../quick/utils/Singleton";
import LoginLogic from "./logic/LoginLogic";
import LoginView from "./view/LoginView";

@registerEntry("LoginEntry",Macro.BUNDLE_RESOURCES,LoginView)
class LoginEntry extends Entry {
    /**@description 是否是主包入口，只能有一个主包入口 */
    isMain = true;
    protected addNetHandler(): void {
        
    }
    protected removeNetHandler(): void {
        
    }
    protected loadResources(completeCb: () => void): void {
       completeCb();
    }
    protected openGameView(): void {
        super.openGameView();
        App.entryManager.onCheckUpdate();
    }
    protected initData(): void {
    }
    protected pauseMessageQueue(): void {
        
    }
    protected resumeMessageQueue(): void {
        
    }

    
    /**@description 管理器通知自己进入GameView */
    onEnter( userData ?: any) {
        super.onEnter(userData);
        //关闭除登录之外的界面
        App.uiManager.closeExcept([LoginView]);
        //销毁不必要单列
        Singleton.destoryExclude([LogicManager]);
        //销毁除LoginLogic之外的逻辑控制器
        App.logicManager.destoryExclude([LoginLogic]);
        Log.d(`--------------onEnterLogin--------------`);
    }
}
